#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

import tarfile
import sys

print("Uncompressing " + sys.argv[1] + " ... ",)
tar = tarfile.open(sys.argv[1], 'r:gz')
list = []
for tarinfo in tar:
    if tarinfo.isdir() or tarinfo.name.endswith("xml"):
        list.append(tarinfo)
tar.extractall(path="./", members=list)
tar.close()
print("Done.")
